import request from '@/api/request'
const {user, auth} = request.config

// 管理员列表
export function list(params) {
  return request.get(user + "/management/admin/adminlist", params)
}

// 角色列表
export function rolelist(params) {
  return request.get(user + "/management/role/queryAll", params)
}


// 修改管理员
export function update(params) {
  return request.post(user + "/management/admin/update", params)
}

// 获取谷歌验证码和密钥
export function getGooglecode(params) {
  return request.get(auth + "/common/googleAuth/createGoogleAuth", params)
}

// 新增管理员
export function add(params) {
  return request.post(user + "/management/admin/add", params, {
    "Content-Type": "application/x-www-form-urlencoded"
  })
}

// 查询单个管理员
export function getById(params) {
  return request.get(user + "/management/admin/query", params);
}

// 删除管理员
export function del(params) {
  return request.post(user + '/management/admin/delete', params);
}

// 修改密码
export function updatepass(params) {
  return request.post(user + "/management/admin/updatePassword", params)
}
